import http from "@/tools/request"


/**
 * 获取咨询信息
 * 
 */
export function getConsultAPI(params) {
  return http({
     method: "get",
     url: "/admin/articles",
     params
   })
   .then(res=>res.data)
 }
/**
 * 新增咨询信息
 * @param {*} data 
 * @returns 
 */
 export function AddConsultAPI(data) {
  return http({
     method: "post",
     url: "/admin/articles",
     data
   })
   .then(res=>res.data)
 }

 /**
 * 删除一条咨询信息
 * @param {*} data 
 * @returns 
 */
 export function RemoveConsultAPI(id) {
  return http({
     method: "delete",
     url: "/admin/articles/"+id,
   })
   .then(res=>res.data)
 }

 /**
 * 修改一条咨询信息
 * @param {*} data 
 * @returns 
 */
 export function EditConsultAPI(id,data) {
  return http({
     method: "patch",
     url: "/admin/articles/"+id,
     data
   })
   .then(res=>res.data)
 }


/**
 * 获取咨询分类
 * 
 */
 export function getConsultCategoriesAPI(params) {
  return http({
     method: "get",
     url: "/admin/article_categories",
     params
   })
   .then(res=>res.data)
 }
 



 